import Foundation

func fibonacci(_ n: Int64) -> Int64 {
    if n <= 1 {
        return n
    }
    return fibonacci(n - 1) + fibonacci(n - 2)
}

print("请输入要计算的 Fibonacci 数字: ", terminator: "")
if let input = readLine(), let n = Int64(input) {
    print(fibonacci(n))
} else {
    print("输入无效")
}
